package com.qfjy.controller;

import com.qfjy.entity.po.Demo;
import com.qfjy.service.DemoService;
import com.qfjy.util.result.ResultCode;
import com.qfjy.util.result.ResultJson;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@RequestMapping("demo")
@Controller
@Api(tags = {"案例模块"})
public class DemoController {

    @Autowired
    private DemoService demoService;
    @GetMapping("list")
    @ResponseBody
    @ApiOperation(value = "查询所有的信息（测试方法）")
    public Object list(){
        List<Demo> list=demoService.selectList();
        return  new ResultJson<>(list, ResultCode.SUCCESS);
    }
}
